import Foundation

protocol DWJsonOptionalValue {
    static func dw_subType() -> Any.Type
}

extension Optional : DWJsonOptionalValue {
    
    static func dw_subType() -> Any.Type {
        var subType : Any.Type = Wrapped.self
        while subType is DWJsonOptionalValue.Type {
            subType = (subType as! DWJsonOptionalValue.Type).dw_subType()
        }
        return subType
    }
    
}
